package com.third.device.mg.serialport.listener

import com.third.device.mg.serialport.help.SocketUnitState
import com.third.device.mg.serialport.help.SocketErrorState

/**
 * company 广东玛格家居有限公司
 * @author smoker
 * @Date 2021/12/29
 * Description:Socket连接监听
 */
@Deprecated("启用,采用Netty框架" ,ReplaceWith("SocketBootstrapManager"),DeprecationLevel.WARNING)
interface ConnectListener {
    /**
     * 连接状态的监听
     * [ip]       Socket的IP
     * [port]     Socket的端口号
     * [state]    Socket的当前状态
     */
    fun connectState(ip:String ,port:Int ,state:SocketUnitState)

    /**
     * 读取服务器的消息回调
     */
    fun readListener(ip:String ,port:Int ,data:ByteArray)

    /**
     * 写入消息时的监听
     */
    fun writeErrorListener(ip:String ,port:Int ,msg:String ,state: SocketErrorState)
}